class MessagesController {
  constructor($scope, $rootScope, $route, $location, $mdMedia, $mdSidenav, $mdDialog, $mdToast, $i18n, $exception, $wechat, $settings, $task, $queue) {
    this.$mdDialog = $mdDialog;
    this.$mdSidenav = $mdSidenav;
    this.$location = $location;
    this.$wechat = $wechat;
    this.$settings = $settings;
    this.$task = $task;
    this.$queue = $queue;
    this.$i18n = $i18n;
    this.$exception = $exception;
    
    this.$task.get().then((result) => {
      this.task = result.response;
      $rootScope.$apply(() => {
        $scope.$parent.main.task = result.response;
      })
      console.log(result);
    },
    (error) => {
      console.log(error);
    })
  }
  
}

MessagesController.$inject = ['$scope', '$rootScope', '$route', '$location', '$mdMedia', '$mdSidenav', '$mdDialog', '$mdToast', '$i18n', '$exception', '$wechat', '$settings', '$task', '$queue'];
angular.module('app').controller('MessagesController', ['$scope', '$rootScope', '$route', '$location', '$mdMedia', '$mdSidenav', '$mdDialog', '$mdToast', '$i18n', '$exception', '$wechat', '$settings', '$task', '$queue', MessagesController]);
